<template>
  <div class="category">
    <h2 class="title">游戏列表</h2>
    <slot :games="games" :x="x"></slot>
    <!-- <slot name="list" :games="games" :x="x"></slot> -->
  </div>
</template>

<script setup lang="ts" name="Game">
import { ref, reactive } from "vue";

let games = reactive([
  { name: "英雄联盟", price: 10 },
  { name: "王者荣耀", price: 20 },
  { name: "穿越火线", price: 30 },
]);
let x = ref(10);
</script>

<style scoped>
.category {
  background-color: skyblue;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 0 10px black;
  width: 300px;
  height: 200px;
}
.title {
  background: orange;
  text-align: center;
  font-size: 20px;
  font-weight: bold;
}
</style>
